<!DOCTYPE html>
<html lang="en" xmlns:v-bind="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>用户信息界面</title>
    <script src="../../js/vue/jquery.js"></script>
    <script src="../../js/vue/vue.js"></script>
    <script src="../../js/vue/jquery.form.js"></script>
</head>
<body>
<div id="app">
    <a href="/views/demo/input.html">添加</a>
    <ul>
        <li v-for="u in users">
            {{u.id}}-{{u.name}}-{{u.age}}-{{u.hobby}} --<a v-bind:href="'/views/demo/input.html?id='+u.id">编辑</a>
        </li>
    </ul>
</div>
<script>
    var app = new Vue({
        el: '#app',
        data: {
            users: []
        },
        mounted: function () {
            /*发送异步请求到后端服务器获取数据,但是此时由于前后端服务器端口号不一致,
            出现跨域访问问题,此时要在后端启动类中配置一下跨域访问权限问题*/
            $.get("http://localhost:8888/users/list", {}, function (data) {
                console.log(data);
                app.users = data;
            })
        }
    })
</script>
</body>
</html>